package com.atde._05_behavioral_design_patterns.memento.game;


import java.util.ArrayList;
import java.util.HashMap;

/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._05_behavioral_design_patterns.memento.game
 * @Author: Del
 * @CreateTime: 2025-06-30  02:44
 * @Description: 备忘录模式应用 --- 恢复角色状态实例 --- 守护者对象用于保存游戏角色状态
 * @Version: 1.0
 */
public class Caretaker {
    // 如果只保存一次状态
    private Memento memento;
    // 如果保存多次状态
    private ArrayList<Memento> mementoList = new ArrayList<>();
    // 如果需要对多个游戏角色保存多个状态
    private HashMap<String, ArrayList<Memento>> roleMementoList = new HashMap<>();

    public Memento getMemento() {
        return memento;
    }

    public void setMemento(Memento memento) {
        this.memento = memento;
    }
}
